using System;
using System.Collections.Generic;
using UnityEngine;

public class AILooksDB : ScriptableObject
{
	[Serializable]
	public class AIPlayerLook
	{
		public string lookName;

		public Persona.Gender gender;

		public List<CustomisationConfig.Look> lookComponents = new List<CustomisationConfig.Look>();

		public CustomisationConfig.Look GetLook(CustomisationConfig.LookSetType setType)
		{
			foreach (CustomisationConfig.Look lookComponent in lookComponents)
			{
				if (lookComponent.type == setType)
				{
					return lookComponent;
				}
			}
			return null;
		}
	}

	private static AILooksDB instance_;

	public List<AIPlayerLook> looks = new List<AIPlayerLook>();

	public static AILooksDB instance
	{
		get
		{
			if (instance_ == null)
			{
				instance_ = Resources.Load("CharacterCustomisation/AILooksDB", typeof(AILooksDB)) as AILooksDB;
			}
			return instance_;
		}
	}

	public AIPlayerLook GetAiLook(string aiLookName)
	{
		foreach (AIPlayerLook look in looks)
		{
			if (look.lookName == aiLookName)
			{
				return look;
			}
		}
		return null;
	}
}
